package com.google.code.p.restrpc.directory;

/**
 * @author dz
 */
public interface Registry extends Directory, ServiceNodeVisitable {
    
    /**
     * @return
     */
    public String[] getNodeAddresses();
    
    /**
     * @return
     */
    public String[] getServiceNames();
    
    /**
     * @param rsd
     */
    public void register(RemoteServiceDefinition rsd);
    
    /**
     * @param rsd
     */
    public void unregister(RemoteServiceDefinition rsd);
    
    /**
     * @param rsd
     */
    public void disable(RemoteServiceDefinition rsd);
    
    /**
     * @param rsd
     */
    public void enable(RemoteServiceDefinition rsd);
    
    /**
     * @param listener
     */
    public void register(RegistryEventListener listener);
    
    /**
     * @param listener
     */
    public void unregister(RegistryEventListener listener);
    
    /**
     * @param address
     * @param port
     * @return
     */
    public boolean isAvailabe(String address, int port);
    
    /**
     * @param address
     * @param port
     */
    public boolean isRegistered(String address, int port);
    
    /**
     * 
     * @param address
     * @param port
     */
    public void activate(String address, int port);
    
    /**
     * @param address
     * @param port
     */
    public void unregisterAll(String address, int port);
    
    /**
     * @param node
     * @param listener
     */
    public void subscribe(String address, int port, NodeEventListener listener);
    
    /**
     * @param node
     * @param listener
     */
    public void unsubscribe(String address, int port, NodeEventListener listener);
    
    /**
     * 
     */
    public void shutdown();
}
